<?php
namespace app\home\controller;
class Recruit extends Common{
    public function _initialize(){
        parent::_initialize();
    }
    public function index(){
        $thisRecruit = db('recruit')->where('id',input('recruitid'))->find();
        $recruit = db('recruitarticle')->order('createtime')->paginate(20);
        $this->assign('recruitid',input('recruitid'));
        $this->assign('catname',$thisRecruit['catname']);
        $this->assign('recruit', $recruit);
        return $this->fetch();
    }
    public function detail(){
        $thisRecruit = db('recruit')->where('id',input('recruitid'))->find();
        $recruitdetail = cache('recruitdetail');
        if(!$recruitdetail){
            $thisRecruitarticle = db('recruitarticle')->where('id',input('reid'))->find();
            cache('recruit', $recruit, 3600);
        }
        $this->assign('catname',$thisRecruit['catname']);
        $this->assign('recruitarticle', $thisRecruitarticle);
        return $this->fetch();
    }
}